<template>

    <el-submenu index="10" style="float:right">
        <template slot="title">
            <i class="fa fa-user-circle-o fa-lg"> &nbsp;</i> {{getUser.name}}
        </template>
        <el-menu-item index="10-1">
            <i class="fa fa-about"> &nbsp;</i> 个人设置
        </el-menu-item>
        <el-menu-item index="10-2" @click="logoutAuth">
            <i class="fa fa-about"> &nbsp;</i> 退出
        </el-menu-item>
    </el-submenu> 
   
</template>

<script>

import { mapMutations, mapGetters } from "vuex";

export default {
    data(){
        return {
            status_desc:'未登录',
            loginStatus:false,
        }
    },

    computed:{
        ...mapGetters(['getUser']),
    },

    methods:{
        ...mapMutations(['setDialogStatus','logout']),
        
        openDialog(key,value){
            this.setDialogStatus({
               key:key,
               value:value
            });
        },

        logoutAuth(){
            this.logout(()=>{
                this.$router.push({ name:'login' });
            })
        }
    }
}


</script>


<style>

</style>
